<?php
// Prevenir que jquery se cargue dos veces
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
Yii::app()->clientScript->scriptMap['jquery.yiigridview.js'] = false;
Util::tsRegisterAssetJs('_form_quick_modal.js');
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'direccion-form',
    'enableAjaxValidation' => false,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => false,
    'focus' => array($model, 'barrio'),
        ));
?>
<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4><i class="icon-home"></i> Registrar Dirección</h4>
</div>
<div class="modal-body">

    <div class="row-fluid">
        <input id="isNewRecord" value="<?php echo $model->isNewRecord ? 1 : 0 ?>" type="hidden">
        <?php echo $form->textFieldRow($model, 'barrio', array('maxlength' => 128)) ?>
        <?php echo $form->textFieldRow($model, 'calle1', array('maxlength' => 128)) ?>
        <?php echo $form->textFieldRow($model, 'calle2', array('maxlength' => 128)) ?>
        <?php echo $form->textFieldRow($model, 'numero_casa', array('maxlength' => 128)) ?>
        <?php echo $form->textFieldRow($model, 'referencia', array('maxlength' => 255)) ?>
        <?php echo $form->hiddenField($model, 'id_persona') ?>
    </div>
</div>

<div class="modal-footer">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'type' => 'success',
        'icon' => 'ok',
        'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        'htmlOptions' => array(
            'onClick' => 'js:saveDireccion("#direccion-form")')
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'icon' => 'remove',
        'label' => Yii::t('AweCrud.app', 'Cancel'),
        'htmlOptions' => array(
            'data-dismiss' => 'modal',)
    ));
    ?>
</div>
<?php $this->endWidget(); ?>